package com.jjwxc.jwjskandriod.adapter;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import com.jjwxc.jwjskandriod.fragment.PurchaseBookFragment;
import com.jjwxc.jwjskandriod.fragment.PurchaseMonthlyFragment;
import com.jjwxc.jwjskandriod.fragment.PurchaseRewardFragment;

public class MyPurchaseAdapter extends FragmentPagerAdapter {
    public MyPurchaseAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int i) {
        Fragment fragment = null;
            switch (i) {
                case 0:
                    fragment = new PurchaseBookFragment("1", "2");
                    break;
                case 1:
                    fragment = new PurchaseMonthlyFragment("4", "5");
                    break;
                case 2:
                    fragment = new PurchaseRewardFragment("4", "5");
                    break;
        }
        assert fragment != null;
        return fragment;
    }

    @Override
    public int getCount() {
        return 3;
    }

}

